package com.applcn.user.controller.feign;

import com.applcn.core.base.Result;
import com.applcn.user.dto.CreateTokenDTO;
import com.applcn.user.dto.InitShopMenuDTO;
import com.applcn.user.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * com.applcn.user.controller.feign
 * Description:
 *
 * @author: 大妖怪
 * @date: 2020-01-18 14:55
 */
@RestController
@RequestMapping("/feign/user")
@RequiredArgsConstructor
public class UserFeign {

    private final UserService userService;

    /**
     * 解析token
     *
     * @param token
     * @return
     */
    @GetMapping("/resolveToken")
    public CreateTokenDTO resolveToken(@RequestParam("token") String token) {
        return userService.resolveToken(token);
    }

    /**
     * 初始化店铺菜单信息
     *
     * @param initShopMenuDTO
     * @return
     */
    @PostMapping("/initShopMenu")
    public Result initShopMenu(@RequestBody InitShopMenuDTO initShopMenuDTO) {
        return userService.initShopMenu(initShopMenuDTO);
    }
}

